<!--
*** Created by zhumin on 2023/09/12.***
*** Description: "运动员页面"
-->
<template>
  <div>
    <common></common>
    <div :class="['component-style', 'athlete']">
      运动员页面
      <div class="delegate-option">
          <el-input v-model="keyName" style="width: 200px; float: right;" prefix-icon="el-icon-search"  @input="searchAthlete" placeholder="姓名/关键字进行查找"></el-input>
          代表队：
          <el-select v-model="selectedValue" placeholder="请选择代表队" filterable>
            <el-option-group
              v-for="group in options"
              :key="group.FirstCharacter"
              :label="group.FirstCharacter"
            >
              <el-option
                v-for="item in group.DelegationData"
                :key="item.DelegationCode"
                :label="item.DelegationName"
                :value="item.DelegationCode"
              >
              </el-option>
            </el-option-group>
          </el-select>
      </div>
      <div class="infoQuery">
        <el-collapse v-model="activeItem">
          <el-collapse-item :name="row.name" v-for="(row, index) in itemInfoList" :key="index">
            <template slot="title">
              <div class="collapse-title">
                <div class="collapse-title-img">
                  <img :src="row.logo" alt="" />
                </div>
                <div>{{ row.name }}</div>
              </div>
            </template>
            <div>
              <el-row class="athlete-row">
                <el-col :span="3"  v-for="item in athleteInfoList" :key="item.PersonCode" v-if="row.code == item.SportCode">
                  <i class="el-icon-s-custom">&nbsp;&nbsp;</i><a href="#" @click="jumpAtheleteDetail">{{ item.PersonName }}</a>
                </el-col>
              </el-row>
            </div>
          </el-collapse-item>
        </el-collapse>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
import common from '@/components/common.vue'
import pageFooter from '@/components/pageFooter.vue'
export default {
  created() {},
  mounted() {},
  data() {
    return {
      selectedValue: 'D012',
      DelegationName: '安徽',
      options: [],
      activeItemName: '围棋',
      activeItemDate: 'ALL',
      keyName:'',
      activeItem: ['围棋', '象棋', '国际象棋', '桥牌', '五子棋', '国际跳棋'],
      athleteInfoList:[
        {SportCode: "CH", PersonCode: "CH0000121", PersonName: "蔡超若", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000335", PersonName: "陈航", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000189", PersonName: "陈继海", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000348", PersonName: "陈朗", PersonGenderCode: "W"}
        ,
        {SportCode: "GO", PersonCode: "GO0000207", PersonName: "陈林涛", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000178", PersonName: "陈榕", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000337", PersonName: "陈伟銮", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000183", PersonName: "陈曦妍", PersonGenderCode: "W"}
        ,
        {SportCode: "DR", PersonCode: "DR0000180", PersonName: "陈晓倩", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000344", PersonName: "陈终生", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000333", PersonName: "高培成", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000185", PersonName: "郭 华", PersonGenderCode: "W"}
        ,
        {SportCode: "CH", PersonCode: "CH0000128", PersonName: "郭楚欣", PersonGenderCode: "W"}
        ,
        {SportCode: "DR", PersonCode: "DR0000179", PersonName: "郭铭康", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000347", PersonName: "洪丽辉", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000342", PersonName: "黄海青", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000334", PersonName: "黄小明", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000127", PersonName: "黄奕天", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000190", PersonName: "柯善林", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000339", PersonName: "李红艳", PersonGenderCode: "W"}
        ,
        {SportCode: "GO", PersonCode: "GO0000202", PersonName: "李镜韬", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000193", PersonName: "李启瀚", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000186", PersonName: "李文钰", PersonGenderCode: "W"}
        ,
        {SportCode: "GO", PersonCode: "GO0000206", PersonName: "李欣宸", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000336", PersonName: "李许枫", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000353", PersonName: "连伟宸", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000196", PersonName: "林 享", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000338", PersonName: "林爱梅", PersonGenderCode: "W"}
        ,
        {SportCode: "CC", PersonCode: "CC0000195", PersonName: "林佳怡", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000351", PersonName: "林嘉辉", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000177", PersonName: "林晓峰", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000126", PersonName: "林禹辰", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000213", PersonName: "林子杰", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000125", PersonName: "刘启涵", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000182", PersonName: "陆品元", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000203", PersonName: "罗 云", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000204", PersonName: "骆焯凡", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000192", PersonName: "欧阳译然", PersonGenderCode: "W"}
        ,
        {SportCode: "GO", PersonCode: "GO0000205", PersonName: "唐瑞鸿", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000210", PersonName: "王鉴椿", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000211", PersonName: "王其红", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000343", PersonName: "王士柃", PersonGenderCode: "W"}
        ,
        {SportCode: "CC", PersonCode: "CC0000187", PersonName: "王晓华", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000209", PersonName: "王迎峰", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000181", PersonName: "王宇晨", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000331", PersonName: "吴安胜", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000176", PersonName: "吴海宁", PersonGenderCode: "W"}
        ,
        {SportCode: "CC", PersonCode: "CC0000194", PersonName: "吴杭宸", PersonGenderCode: "M"}
        ,
        {SportCode: "GB", PersonCode: "GB0000118", PersonName: "吴侃", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000212", PersonName: "吴锶潇", PersonGenderCode: "M"}
        ,
        {SportCode: "GB", PersonCode: "GB0000119", PersonName: "谢增忠", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000124", PersonName: "熊丽娟", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000345", PersonName: "徐瑞红", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000352", PersonName: "许志辉", PersonGenderCode: "M"}
        ,
        {SportCode: "DR", PersonCode: "DR0000184", PersonName: "姚懿航", PersonGenderCode: "M"}
        ,
        {SportCode: "GB", PersonCode: "GB0000120", PersonName: "姚兆贤", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000349", PersonName: "叶宝辉", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000120", PersonName: "叶晓天", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000191", PersonName: "张 烨", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000122", PersonName: "张海威", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000340", PersonName: "张贺梅", PersonGenderCode: "W"}
        ,
        {SportCode: "GB", PersonCode: "GB0000117", PersonName: "张华晟", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000350", PersonName: "张生音", PersonGenderCode: "M"}
        ,
        {SportCode: "GO", PersonCode: "GO0000208", PersonName: "张文洲", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000332", PersonName: "张小平", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000123", PersonName: "张子玥", PersonGenderCode: "W"}
        ,
        {SportCode: "DR", PersonCode: "DR0000185", PersonName: "赵浚天", PersonGenderCode: "M"}
        ,
        {SportCode: "CC", PersonCode: "CC0000186", PersonName: "郑伙添", PersonGenderCode: "M"}
        ,
        {SportCode: "BR", PersonCode: "BR0000346", PersonName: "郑建平", PersonGenderCode: "M"}
        ,
        {SportCode: "CH", PersonCode: "CH0000129", PersonName: "郑卓", PersonGenderCode: "W"}
        ,
        {SportCode: "GB", PersonCode: "GB0000121", PersonName: "钟启馨", PersonGenderCode: "W"}
        ,
        {SportCode: "BR", PersonCode: "BR0000341", PersonName: "周瑛", PersonGenderCode: "W"},
        {SportCode: "CC", PersonCode: "CC0000188", PersonName: "卓赞烽", PersonGenderCode: "M"}],
      itemInfoList: [
        {
          name: '围棋',
          code: 'GO',
          logo: require('../../assets/img/daily/GO.png'),
          flag: true,
          tableData: 'goResultList'
        },
        {
          name: '象棋',
          code: 'CC',
          logo: require('../../assets/img/daily/CC.png'),
          flag: false,
          tableData: 'goResultList'
        },
        {
          name: '国际象棋',
          code: 'CH',
          logo: require('../../assets/img/daily/CH.png'),
          flag: false,
          tableData: 'goResultList'
        },
        {
          name: '桥牌',
          code: 'BR',
          logo: require('../../assets/img/daily/BR.png'),
          flag: false,
          tableData: 'goResultList'
        },
        {
          name: '五子棋',
          code: 'GB',
          logo: require('../../assets/img/daily/GB.png'),
          flag: false,
          tableData: 'goResultList'
        },
        {
          name: '国际跳棋',
          code: 'DR',
          logo: require('../../assets/img/daily/DR.png'),
          flag: false,
          tableData: 'goResultList'
        }
      ],
      AllDelegations: [
        {
          FirstCharacter: 'A',
          DelegationData: [{ DelegationCode: 'D012', DelegationName: '安徽' }]
        },
        {
          FirstCharacter: 'B',
          DelegationData: [{ DelegationCode: 'D001', DelegationName: '北京' }]
        },
        {
          FirstCharacter: 'C',
          DelegationData: [{ DelegationCode: 'D022', DelegationName: '重庆' }]
        },
        {
          FirstCharacter: 'D',
          DelegationData: [{ DelegationCode: 'D032', DelegationName: '大连' }]
        },
        {
          FirstCharacter: 'F',
          DelegationData: [{ DelegationCode: 'D013', DelegationName: '福建' }]
        },
        {
          FirstCharacter: 'G',
          DelegationData: [
            { DelegationCode: 'D019', DelegationName: '广东' },
            { DelegationCode: 'D020', DelegationName: '广西' },
            { DelegationCode: 'D024', DelegationName: '贵州' },
            { DelegationCode: 'D028', DelegationName: '甘肃' }
          ]
        },
        {
          FirstCharacter: 'H',
          DelegationData: [
            { DelegationCode: 'D003', DelegationName: '河北' },
            { DelegationCode: 'D008', DelegationName: '黑龙江' },
            { DelegationCode: 'D016', DelegationName: '河南' },
            { DelegationCode: 'D017', DelegationName: '湖北' },
            { DelegationCode: 'D018', DelegationName: '湖南' },
            { DelegationCode: 'D021', DelegationName: '海南' },
            { DelegationCode: 'D037', DelegationName: '火车头体协' },
            { DelegationCode: 'D044', DelegationName: '化工体协' }
          ]
        },
        {
          FirstCharacter: 'J',
          DelegationData: [
            { DelegationCode: 'D007', DelegationName: '吉林' },
            { DelegationCode: 'D010', DelegationName: '江苏' },
            { DelegationCode: 'D014', DelegationName: '江西' },
            { DelegationCode: 'D038', DelegationName: '金融体协' }
          ]
        },
        {
          FirstCharacter: 'K',
          DelegationData: [{ DelegationCode: 'D045', DelegationName: '科学院体协' }]
        },
        {
          FirstCharacter: 'L',
          DelegationData: [
            { DelegationCode: 'D006', DelegationName: '辽宁' },
            { DelegationCode: 'D042', DelegationName: '林业体协' }
          ]
        },
        {
          FirstCharacter: 'M',
          DelegationData: [{ DelegationCode: 'D040', DelegationName: '煤矿体协' }]
        },
        {
          FirstCharacter: 'N',
          DelegationData: [
            { DelegationCode: 'D005', DelegationName: '内蒙古' },
            { DelegationCode: 'D030', DelegationName: '宁夏' },
            { DelegationCode: 'D034', DelegationName: '宁波' }
          ]
        },
        {
          FirstCharacter: 'Q',
          DelegationData: [
            { DelegationCode: 'D029', DelegationName: '青海' },
            { DelegationCode: 'D033', DelegationName: '青岛' },
            { DelegationCode: 'D046', DelegationName: '企业体协' }
          ]
        },
        {
          FirstCharacter: 'S',
          DelegationData: [
            { DelegationCode: 'D004', DelegationName: '山西' },
            { DelegationCode: 'D009', DelegationName: '上海' },
            { DelegationCode: 'D015', DelegationName: '山东' },
            { DelegationCode: 'D023', DelegationName: '四川' },
            { DelegationCode: 'D027', DelegationName: '陕西' },
            { DelegationCode: 'D036', DelegationName: '深圳' },
            { DelegationCode: 'D039', DelegationName: '石油体协' }
          ]
        },
        {
          FirstCharacter: 'T',
          DelegationData: [
            { DelegationCode: 'D002', DelegationName: '天津' },
            { DelegationCode: 'D043', DelegationName: '通信体协' }
          ]
        },
        {
          FirstCharacter: 'X',
          DelegationData: [
            { DelegationCode: 'D026', DelegationName: '西藏' },
            { DelegationCode: 'D031', DelegationName: '新疆' },
            { DelegationCode: 'D035', DelegationName: '厦门' },
            { DelegationCode: 'D047', DelegationName: '香港象棋总会' },
            { DelegationCode: 'D048', DelegationName: '香港国际跳棋协会' },
            { DelegationCode: 'D049', DelegationName: '香港桥牌协会' }
          ]
        },
        {
          FirstCharacter: 'Y',
          DelegationData: [{ DelegationCode: 'D025', DelegationName: '云南' }]
        }
      ],
    }
  },
  watch: {},
  computed: {
    ...mapState({})
  },
  filters: {},
  components: {
    common,
    pageFooter
  },
  methods: {
    searchAthlete(){
      return this.athleteInfoList.filter(item => {
        return item.PersonName.includes(this.keyName);
      });
    },
    jumpAtheleteDetail(){
      this.$router.push('/detail');
    }
  },
  created() {
    this.options = JSON.parse(JSON.stringify(this.AllDelegations))
  },
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/athlete.scss';
</style>
